-
Notifications
You must be signed in to change notification settings - Fork 14.1k
Clippy subtree update #149425
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
flip1995
wants to merge
89
commits into
rust-lang:main
Choose a base branch
from
flip1995:clippy-subtree-update
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Clippy subtree update #149425
+6,809
−2,227
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
will improve the diff for the next commit
- move `is_allowed_vec_method` (a stripped-down version of it, anyway, as the function doesn't make sense as is out of context) to utils, as it's shared between `useless_vec` and `ptr_arg` - add another test for non-standard macro brace case - rm unneeded `allow`s - rm duplicated tests - add comments to some tests
…ration_sugg` This doesn't change any functionality, but will make it easier to switch to a uniform message in the next commit. Also a nice simplification imo
Diff best seen with whitespace ignored
changelog: [`sliced_string_as_bytes`]: don't fire on `str[..].as_bytes()` So I ran into this in some codebase I was working on, where the lint fired on this line: ```rust let string: &str; string[..].as_bytes() ``` So I was trying to understand the rationale behind this lint, and it says: > It involves doing an unnecessary UTF-8 alignment check which is less efficient, and can cause a panic. This is obviously not true in the case where a `RangeFull` slice is being taken, since there is no UTF-8 boundary check, and no panic can be caused. So I created an exemption for `RangeFull`s. Two other notes: 1. I'm not sure the word "alignment" in the lint's description (quoted above) is really correct, should probably say "char boundary" instead? 2. I might be missing something, but isn't there a lint for doing superfluous slice indexing, and then calling a slice method? e.g. `str[..].len()` or `slice[..].len()`, where `str` and `slice` are `&str` and `&[T]`, respectively. If we had one, I would expect *it* to fire for the example code I quoted above.
…ffleLapkin remove support for `typeof` see rust-lang/compiler-team#940 closes rust-lang#148700 This also enables checks for invariants previously broken by `typeof` again. r? types
… expansion (rust-lang#15958) This means some existing test cases won't get linted anymore, but imo that's preferable to false-positives. Fixes rust-lang/rust-clippy#14548 changelog: [`equatable_if_let`]: don't lint if pattern or initializer come from expansion
First commits fixes a display issue when JS is disabled. Before: <img width="962" height="144" alt="image" src="https://github.com/user-attachments/assets/d9ca8077-2486-49eb-9a99-bd396c0d67fa" /> After: <img width="962" height="144" alt="Screenshot From 2025-11-18 14-12-52" src="https://github.com/user-attachments/assets/a5f0c390-7e3c-4ad5-bb0d-95e0c1a1889b" /> The two other commits remove (each) one DOM level in the filters menu. changelog: none r? @Alexendoo
…ns (rust-lang#16102) Currently the `sugg` utility treats all `ExprKind::Match` expressions as potentially needing brackets, and therefore many lints will add parenthesis around them. However this includes desugared match expressions like the `?` and `.await` operators. In this PR I have updated the utility to only treat match expressions which include a code block as needing parenthesis, as the other types have similar precedence rules and expectations to things like member access and I think can be treated like as such. While this change is small on paper it touches a large amount of code due to changing a cross cutting concern, I am happy to add additional tests if we think it is needed, but I wanted to get a feel for if this is even a sensible change to be doing and what the expectations were around the level of testing needed before investing more time into it. Regarding not putting a specific lint in the changelog, determining all the lints this could possibly effect would be possible but take some time, and I wonder if it would be a bit too noisy in the changelog. Open to suggestions about how best to address that. fixes rust-lang/rust-clippy#16045 changelog: stop inserting unnecessary brackets around `x?` and `x.await` expressions in suggestions
changelog: none
r? @ghost changelog: none
Collaborator
|
Some changes occurred in src/tools/clippy cc @rust-lang/clippy |
This comment has been minimized.
This comment has been minimized.
08be39b to
0a1fa79
Compare
Collaborator
|
Member
|
@bors r+ p=1 subtree sync |
Collaborator
Member
|
@bors r+ p=1 rollup=never |
Collaborator
|
💡 This pull request was already approved, no need to approve it again.
|
Collaborator
Collaborator
|
The job Click to see the possible cause of the failure (guessed by this bot) |
Member
|
lol |
Zalathar
added a commit
to Zalathar/rust
that referenced
this pull request
Nov 29, 2025
…gen-gcc-remove-unnecessary-unwrap, r=workingjubilee Remove an unnecessary `unwrap` in `rustc_codegen_gcc` This should hopefully unblock rust-lang#149425 (I couldn't find an in-flight PR that was already doing this). I've tested locally with the `master` version of Clippy that `rustc_codegen_gcc` passes the lints (the syncing PR could still fail for other reasons however). I understand that `rustc_codegen_gcc` is normally developed [outside of this repo](https://github.com/rust-lang/rustc_codegen_gcc) but my understanding is that that repo is two-way synced regularly and hopefully it is acceptable to do this tiny change here to unblock the Clippy syncing PR (is there an established process for how to unblock these syncing PRs?). Of course feel free to close if this isn't the expected process.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
S-waiting-on-author
Status: This is awaiting some action (such as code changes or more information) from the author.
T-clippy
Relevant to the Clippy team.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
r? @Manishearth
1 day late. Totally forgot about this yesterday.